SlideShare a Scribd company logo
Fast and Easy XHTML - XHTML Tutorial, By Shirley E. Kaiser, M.A., SKDesigns - Website Tips at Websitetips.com




 December, 2001, Updated March 2006

 Copyright © 2001-2006, Shirley E. Kaiser, M.A., SKDesigns. All rights reserved.




 Wondering how to turn your HTML markup into XHTML? Here are a few quick tips to

 teach you the very basics, a sample XHTML document, and resources for more

 information.


 If you already know HTML, I suspect you can learn how to implement these markup

 changes within a couple of hours. If you just dig in and give it a try, I think you'll be

 pleasantly surprised to see that it's easier than you may have thought.


 Ready to give it a try? Let's go....



 The Basics
http://websitetips.com/articles/xhtml/basics/ (1 of 6)3/20/2006 11:32:47 AM
Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com




           1. All your markup needs to be in lowercase. For example, instead of <P></P>

                 it needs to be <p></p> for XHTML.

           2. Every tag must have a corresponding ending tag, such as <p></p> and

                 <li></li>. Some tags don't have a corresponding ending tag, such as <br>,

                 <hr>, and others. Those tags, to be backward compatible will look like this

                 instead:


                 <br />

                 <hr />


                 (Below is an XHTML document sample that shows more of these.)

           3. Every attribute value must be in double quotes, such as:

                 <img src="image.gif" height="150" width="40" alt="funny face" />


                 Notice that since the <img> tag doesn't have a corresponding ending tag that

                 it also is closed with the extra space and slash, too.

           4. Nesting must be correct (and symmetrical). HTML also requires correct

                 nesting, but it wasn't always as problematic in browsers. XHTML requires it

                 done properly, though. For example, this is incorrect:

                 <p><strong>Text</p></strong>


                 This is correct:

                 <p><strong>Text</strong></p>

           5. An ampersand (&) within an attribute value must use its character entity

                 reference. For example, a URL like this:


                 <a href="http://www.foo.com/cgi-bin/

http://websitetips.com/articles/xhtml/basics/ (2 of 6)3/20/2006 11:32:47 AM
Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com



                 class.pl?saturday&night&live">foo</a>


                 must instead be:


                 <a href="http://www.foo.com/cgi-bin/

                 class.pl?saturday&amp;night&amp;live">foo</a>

           6. Your markup must be well-formed. If you've already been writing good

                 markup that validates with W3C, it's no big deal. If not, it's a good time to

                 clean up your markup.



 A New DTD

 In addition to the above is a new DTD, too. The sample below is for XHTML 1.0

 transitional.




            <?xml version="1.0" encoding="UTF-8"?>

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

            "http://www.w3.org/TR/xhtml1/DTD/

            xhtml1-transitional.dtd">

            <html xmlns="http://www.w3.org/1999/xhtml">



 The first line, beginning with <?xml version= ..., is the xml prolog, and it's

 recommended but not required. Note that using the xml prolog will trigger IE6 Quirks

 Mode, so you might want to leave it out or learn more about it before deciding. The



http://websitetips.com/articles/xhtml/basics/ (3 of 6)3/20/2006 11:32:47 AM
Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com
 xml prolog tells the browser that your document is based upon a DTD using XML, and

 that it's using a standard character encoding.


 The second line, beginning with <!DOCTYPE ....>, will look more familiar to you, this

 time representing XHTML 1.0 transitional.


 Then, the last line beginning with <html xmlns=" ....> replaces the <html>

 element, telling the browser the language and the namespace.


 Below is a sample XHTML document. Note that all the markup is in lowercase, there

 are quotes around the attribute values, the new endings for the tags that don't have

 corresponding ending tags, and it is all well formed.



 A Sample XHTML Document


            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

            <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
            <title>Nifty New XHTML document</title>

            <meta name="description" content="This is the coolest XHTML document
            on the Internet." />

            <link rel="stylesheet" type="text/css" href="stylesheet.css" />

            </head>

            <body>

            <p>Content here.</p>
            <p>Content here.</p>



http://websitetips.com/articles/xhtml/basics/ (4 of 6)3/20/2006 11:32:47 AM
Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com

            <ol>
               <li>List item one</li>
               <li>List item two</li>
            </ol>


            <dl>
               <dt>Term</dt>
               <dd>definition</dd>
            </dl>


            <img src="image.gif" height="150" width="40" alt="funny face" />

            <br/>

            <table class="data">
            <tr><td>Green eggs</td><td>Ham</td></tr>
            </table>



            <form method="get" action="foo">

            <select name="">
            <option value="all">All Products</option>
            <option value="books">Books</option>
            </select>

            <input type="text" name="keyword" size="10"
            value="" />

            <input type="submit" name="Search" value="Go!" />

            </form>


            </body>
            </html>




 Resources




http://websitetips.com/articles/xhtml/basics/ (5 of 6)3/20/2006 11:32:47 AM
Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com




                                        To learn lots more about XHTML, check out WebsiteTips.com's
 XHTML section for annotated links to W3C recommendations, articles and tips, sites

 devoted to XHTML, and more.


 Also highly recommended is Molly Holzschlag's book, XML, HTML, XHTML Magic

 published by New Riders.



         This tutorial was originally published December 09, 2001 at Brainstorms and Raves.



         Copyright © 2001 Shirley E. Kaiser, M.A. All Rights Reserved. Reprint with permission only.

         Please contact the author for details.




                                               Today is March 20, 2006 - PST
                                Copyright © 1996-2006 WebsiteTips.com. All rights reserved.
                                           Created and maintained by SKDesigns.


                                      http://websitetips.com/articles/xhtml/basics/
                                      Last modified March 20, 2006 - 7:16pm PST




http://websitetips.com/articles/xhtml/basics/ (6 of 6)3/20/2006 11:32:47 AM

More Related Content

What's hot (19)

PDF
Modular HTML, CSS, & JS Workshop
Shay Howe
 
PPTX
Introduction to HTML and CSS
danpaquette
 
PDF
A Primer on HTML 5 - By Nick Armstrong
Nick Armstrong
 
PDF
Findability Bliss Through Web Standards
Aarron Walter
 
KEY
Slow kinda sucks
Tim Wright
 
PDF
An Intro to HTML & CSS
Shay Howe
 
PDF
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
Michaela Lehr
 
PDF
[Access U 2010] HTML5 & Accessibility
Christopher Schmitt
 
PPSX
HTML & XHTML Basics
Hossein Zahed
 
PPTX
Html basics-auro skills
BoneyGawande
 
PDF
Intro to HTML 5 / CSS 3
Tadpole Collective
 
PDF
CSS Refresher
Gerson Abesamis
 
PDF
HTML5 Essentials
Marc Grabanski
 
PPT
Boostrap basics
JTechTown
 
PPTX
Basic HTML
sunmitraeducation
 
PDF
Front End Best Practices
Holger Bartel
 
PPTX
Html - By Auroskkil
BoneyGawande
 
PPT
Twitter bootstrap training_session_ppt
Radheshyam Kori
 
PDF
CSS Best practice
Russ Weakley
 
Modular HTML, CSS, & JS Workshop
Shay Howe
 
Introduction to HTML and CSS
danpaquette
 
A Primer on HTML 5 - By Nick Armstrong
Nick Armstrong
 
Findability Bliss Through Web Standards
Aarron Walter
 
Slow kinda sucks
Tim Wright
 
An Intro to HTML & CSS
Shay Howe
 
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
Michaela Lehr
 
[Access U 2010] HTML5 & Accessibility
Christopher Schmitt
 
HTML & XHTML Basics
Hossein Zahed
 
Html basics-auro skills
BoneyGawande
 
Intro to HTML 5 / CSS 3
Tadpole Collective
 
CSS Refresher
Gerson Abesamis
 
HTML5 Essentials
Marc Grabanski
 
Boostrap basics
JTechTown
 
Basic HTML
sunmitraeducation
 
Front End Best Practices
Holger Bartel
 
Html - By Auroskkil
BoneyGawande
 
Twitter bootstrap training_session_ppt
Radheshyam Kori
 
CSS Best practice
Russ Weakley
 

Viewers also liked (20)

PDF
LittleBookOfRuby
tutorialsruby
 
PDF
00 ruby tutorial
Walker Maidana
 
PDF
Ruby1_full
tutorialsruby
 
PDF
Winter%200405%20-%20Advanced%20Javascript
tutorialsruby
 
PDF
Ruby
besen
 
PDF
Ruby quick ref
Tharcius Silva
 
PDF
Book of ruby
phongbk1609
 
PDF
eng2u3less38
tutorialsruby
 
PDF
Ruby Essentials
Arulalan T
 
PDF
&lt;img src="../i/r_14.png" />
tutorialsruby
 
PPTX
Ruby :: Training 1
Pavel Tyk
 
PPS
Ruby 1.9.3 Basic Introduction
Prabu D
 
PDF
Ruby basic3
Ho Yin Liu
 
PDF
Ruby cheat sheet
Tharcius Silva
 
PDF
Ruby basic2
Ho Yin Liu
 
PDF
Ruby
ThirdWay
 
PDF
Ruby basic
Ho Yin Liu
 
KEY
Ruby
James Gray
 
PDF
Confident Ruby: Be A Coding Hemingway
Matthew Salerno
 
PDF
Object-Oriented Programming & Ruby
Amine Sadry
 
LittleBookOfRuby
tutorialsruby
 
00 ruby tutorial
Walker Maidana
 
Ruby1_full
tutorialsruby
 
Winter%200405%20-%20Advanced%20Javascript
tutorialsruby
 
Ruby
besen
 
Ruby quick ref
Tharcius Silva
 
Book of ruby
phongbk1609
 
eng2u3less38
tutorialsruby
 
Ruby Essentials
Arulalan T
 
&lt;img src="../i/r_14.png" />
tutorialsruby
 
Ruby :: Training 1
Pavel Tyk
 
Ruby 1.9.3 Basic Introduction
Prabu D
 
Ruby basic3
Ho Yin Liu
 
Ruby cheat sheet
Tharcius Silva
 
Ruby basic2
Ho Yin Liu
 
Ruby
ThirdWay
 
Ruby basic
Ho Yin Liu
 
Confident Ruby: Be A Coding Hemingway
Matthew Salerno
 
Object-Oriented Programming & Ruby
Amine Sadry
 
Ad

Similar to xhtml_basics (20)

PDF
HTML practical file
Kuldeep Sharma
 
PPTX
Html and Xhtml
Chhom Karath
 
PPTX
Lecture 4 - Adding XTHML for the Web
phanleson
 
KEY
HTML/CSS Lecture 1
Lee Lundrigan
 
PPT
IntroHTMzczczscasasaklahduasihiaSUJScgGJKKL.ppt
diciembrejatcs
 
PDF
Introduction to XML, XHTML and CSS
Jussi Pohjolainen
 
PPT
Wt-UNNIT-1 (1).ppt
GReshma10
 
PPTX
HTML AND XML ppt.pptx
SRIRAM763018
 
PPT
xhtml_css.ppt
fakeaccount225095
 
PDF
Unit 4 - HTTP and the Web Services - IT
Deepraj Bhujel
 
PDF
Introduction to XHTML
Hend Al-Khalifa
 
PPT
Lecture07 ASDFASFA ASD ASD SDS XHTML.ppt
DrKBManwade
 
PDF
Rc064 010d Core Html 1
troopergreen
 
PPTX
Markup language classification, designing static and dynamic
Ankita Bhalla
 
PDF
Website designing company in faridabad
Css Founder
 
PPT
Xhtml
Manav Prasad
 
PPT
Xhtml
Abdul Khan
 
PPT
Introduction to web design
SynapseindiaComplaints
 
HTML practical file
Kuldeep Sharma
 
Html and Xhtml
Chhom Karath
 
Lecture 4 - Adding XTHML for the Web
phanleson
 
HTML/CSS Lecture 1
Lee Lundrigan
 
IntroHTMzczczscasasaklahduasihiaSUJScgGJKKL.ppt
diciembrejatcs
 
Introduction to XML, XHTML and CSS
Jussi Pohjolainen
 
Wt-UNNIT-1 (1).ppt
GReshma10
 
HTML AND XML ppt.pptx
SRIRAM763018
 
xhtml_css.ppt
fakeaccount225095
 
Unit 4 - HTTP and the Web Services - IT
Deepraj Bhujel
 
Introduction to XHTML
Hend Al-Khalifa
 
Lecture07 ASDFASFA ASD ASD SDS XHTML.ppt
DrKBManwade
 
Rc064 010d Core Html 1
troopergreen
 
Markup language classification, designing static and dynamic
Ankita Bhalla
 
Website designing company in faridabad
Css Founder
 
Xhtml
Abdul Khan
 
Introduction to web design
SynapseindiaComplaints
 
Ad

More from tutorialsruby (20)

PDF
&lt;img src="../i/r_14.png" />
tutorialsruby
 
PDF
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
tutorialsruby
 
PDF
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
tutorialsruby
 
PDF
&lt;img src="../i/r_14.png" />
tutorialsruby
 
PDF
Standardization and Knowledge Transfer – INS0
tutorialsruby
 
PDF
xhtml_basics
tutorialsruby
 
PDF
xhtml-documentation
tutorialsruby
 
PDF
xhtml-documentation
tutorialsruby
 
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
PDF
HowTo_CSS
tutorialsruby
 
PDF
HowTo_CSS
tutorialsruby
 
PDF
BloggingWithStyle_2008
tutorialsruby
 
PDF
BloggingWithStyle_2008
tutorialsruby
 
PDF
cascadingstylesheets
tutorialsruby
 
PDF
cascadingstylesheets
tutorialsruby
 
PDF
Winter%200405%20-%20Advanced%20Javascript
tutorialsruby
 
PDF
eng2u3less38
tutorialsruby
 
&lt;img src="../i/r_14.png" />
tutorialsruby
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
tutorialsruby
 
&lt;img src="../i/r_14.png" />
tutorialsruby
 
Standardization and Knowledge Transfer – INS0
tutorialsruby
 
xhtml_basics
tutorialsruby
 
xhtml-documentation
tutorialsruby
 
xhtml-documentation
tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
HowTo_CSS
tutorialsruby
 
HowTo_CSS
tutorialsruby
 
BloggingWithStyle_2008
tutorialsruby
 
BloggingWithStyle_2008
tutorialsruby
 
cascadingstylesheets
tutorialsruby
 
cascadingstylesheets
tutorialsruby
 
Winter%200405%20-%20Advanced%20Javascript
tutorialsruby
 
eng2u3less38
tutorialsruby
 

Recently uploaded (20)

PDF
Alpha Altcoin Setup : TIA - 19th July 2025
CIFDAQ
 
PDF
Arcee AI - building and working with small language models (06/25)
Julien SIMON
 
PDF
UiPath on Tour London Community Booth Deck
UiPathCommunity
 
PDF
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PDF
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
PDF
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
PPTX
Simplifying End-to-End Apache CloudStack Deployment with a Web-Based Automati...
ShapeBlue
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
PDF
visibel.ai Company Profile – Real-Time AI Solution for CCTV
visibelaiproject
 
PDF
Shuen Mei Parth Sharma Boost Productivity, Innovation and Efficiency wit...
AWS Chicago
 
PDF
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
PPTX
Top Managed Service Providers in Los Angeles
Captain IT
 
PPTX
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
PDF
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
PDF
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
PDF
Generative AI in Healthcare: Benefits, Use Cases & Challenges
Lily Clark
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Alpha Altcoin Setup : TIA - 19th July 2025
CIFDAQ
 
Arcee AI - building and working with small language models (06/25)
Julien SIMON
 
UiPath on Tour London Community Booth Deck
UiPathCommunity
 
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
Simplifying End-to-End Apache CloudStack Deployment with a Web-Based Automati...
ShapeBlue
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
visibel.ai Company Profile – Real-Time AI Solution for CCTV
visibelaiproject
 
Shuen Mei Parth Sharma Boost Productivity, Innovation and Efficiency wit...
AWS Chicago
 
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
Top Managed Service Providers in Los Angeles
Captain IT
 
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
Generative AI in Healthcare: Benefits, Use Cases & Challenges
Lily Clark
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 

xhtml_basics

  • 1. Fast and Easy XHTML - XHTML Tutorial, By Shirley E. Kaiser, M.A., SKDesigns - Website Tips at Websitetips.com December, 2001, Updated March 2006 Copyright © 2001-2006, Shirley E. Kaiser, M.A., SKDesigns. All rights reserved. Wondering how to turn your HTML markup into XHTML? Here are a few quick tips to teach you the very basics, a sample XHTML document, and resources for more information. If you already know HTML, I suspect you can learn how to implement these markup changes within a couple of hours. If you just dig in and give it a try, I think you'll be pleasantly surprised to see that it's easier than you may have thought. Ready to give it a try? Let's go.... The Basics http://websitetips.com/articles/xhtml/basics/ (1 of 6)3/20/2006 11:32:47 AM
  • 2. Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com 1. All your markup needs to be in lowercase. For example, instead of <P></P> it needs to be <p></p> for XHTML. 2. Every tag must have a corresponding ending tag, such as <p></p> and <li></li>. Some tags don't have a corresponding ending tag, such as <br>, <hr>, and others. Those tags, to be backward compatible will look like this instead: <br /> <hr /> (Below is an XHTML document sample that shows more of these.) 3. Every attribute value must be in double quotes, such as: <img src="image.gif" height="150" width="40" alt="funny face" /> Notice that since the <img> tag doesn't have a corresponding ending tag that it also is closed with the extra space and slash, too. 4. Nesting must be correct (and symmetrical). HTML also requires correct nesting, but it wasn't always as problematic in browsers. XHTML requires it done properly, though. For example, this is incorrect: <p><strong>Text</p></strong> This is correct: <p><strong>Text</strong></p> 5. An ampersand (&) within an attribute value must use its character entity reference. For example, a URL like this: <a href="http://www.foo.com/cgi-bin/ http://websitetips.com/articles/xhtml/basics/ (2 of 6)3/20/2006 11:32:47 AM
  • 3. Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com class.pl?saturday&night&live">foo</a> must instead be: <a href="http://www.foo.com/cgi-bin/ class.pl?saturday&amp;night&amp;live">foo</a> 6. Your markup must be well-formed. If you've already been writing good markup that validates with W3C, it's no big deal. If not, it's a good time to clean up your markup. A New DTD In addition to the above is a new DTD, too. The sample below is for XHTML 1.0 transitional. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> The first line, beginning with <?xml version= ..., is the xml prolog, and it's recommended but not required. Note that using the xml prolog will trigger IE6 Quirks Mode, so you might want to leave it out or learn more about it before deciding. The http://websitetips.com/articles/xhtml/basics/ (3 of 6)3/20/2006 11:32:47 AM
  • 4. Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com xml prolog tells the browser that your document is based upon a DTD using XML, and that it's using a standard character encoding. The second line, beginning with <!DOCTYPE ....>, will look more familiar to you, this time representing XHTML 1.0 transitional. Then, the last line beginning with <html xmlns=" ....> replaces the <html> element, telling the browser the language and the namespace. Below is a sample XHTML document. Note that all the markup is in lowercase, there are quotes around the attribute values, the new endings for the tags that don't have corresponding ending tags, and it is all well formed. A Sample XHTML Document <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Nifty New XHTML document</title> <meta name="description" content="This is the coolest XHTML document on the Internet." /> <link rel="stylesheet" type="text/css" href="stylesheet.css" /> </head> <body> <p>Content here.</p> <p>Content here.</p> http://websitetips.com/articles/xhtml/basics/ (4 of 6)3/20/2006 11:32:47 AM
  • 5. Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com <ol> <li>List item one</li> <li>List item two</li> </ol> <dl> <dt>Term</dt> <dd>definition</dd> </dl> <img src="image.gif" height="150" width="40" alt="funny face" /> <br/> <table class="data"> <tr><td>Green eggs</td><td>Ham</td></tr> </table> <form method="get" action="foo"> <select name=""> <option value="all">All Products</option> <option value="books">Books</option> </select> <input type="text" name="keyword" size="10" value="" /> <input type="submit" name="Search" value="Go!" /> </form> </body> </html> Resources http://websitetips.com/articles/xhtml/basics/ (5 of 6)3/20/2006 11:32:47 AM
  • 6. Fast and Easy XHTML, XHTML Tutorial, HTML, Web Standards, by Shirley ...ML Tutorials, CSS Tutorials and Tips, Website Tips at Websitetips.com To learn lots more about XHTML, check out WebsiteTips.com's XHTML section for annotated links to W3C recommendations, articles and tips, sites devoted to XHTML, and more. Also highly recommended is Molly Holzschlag's book, XML, HTML, XHTML Magic published by New Riders. This tutorial was originally published December 09, 2001 at Brainstorms and Raves. Copyright © 2001 Shirley E. Kaiser, M.A. All Rights Reserved. Reprint with permission only. Please contact the author for details. Today is March 20, 2006 - PST Copyright © 1996-2006 WebsiteTips.com. All rights reserved. Created and maintained by SKDesigns. http://websitetips.com/articles/xhtml/basics/ Last modified March 20, 2006 - 7:16pm PST http://websitetips.com/articles/xhtml/basics/ (6 of 6)3/20/2006 11:32:47 AM